package cn.kgc.validator;

import cn.kgc.anntation.CheckPmsBrandNameAnnotation;
import cn.kgc.entity.PmsBrand;
import org.apache.commons.lang.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * <p>验证品牌名字</p>
 *
 */
public class CheckPmsBrandNameValidator implements ConstraintValidator<CheckPmsBrandNameAnnotation, PmsBrand> {
    @Override
    public boolean isValid(PmsBrand pmsBrand, ConstraintValidatorContext constraintValidatorContext) {
        //品牌名为空，验证失败
        if (StringUtils.isNotBlank(pmsBrand.getName())){
            return false;
        }
        return false;
    }
}